﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TouchAction : MonoBehaviour {


    public GameObject gameObj;
    private bool flag0; //0停止 1前进 2后退
   // private bool flag1;
	void Start () {
        
	}

    public void forwardpAction(){
        this.flag0 = true;
      //  this.flag1 = false;
       // gameObj.transform.Translate(Vector3.back * time * 0.1f);
    }

    public void backAction(){
        this.flag0 = false;
      //  this.flag1 = true;
        //gameObj.transform.Translate(Vector3.forward * time * 0.1f);
    }

    public void attack(){
        Debug.Log("attack");
    }


    // Update is called once per frame
    void Update () {

        //if (flag0){
        //    Debug.Log("前进");
        //}else{
        //    Debug.Log("后退");
        //}

		//float time = 0.1f;
		//Debug.Log("--------" + flag);
		//if (flag == 1)
		//{
		//	gameObj.transform.Translate(Vector3.back * time * 0.1f);
		//}
		//else if (flag == 2)
		//{
		//	gameObj.transform.Translate(Vector3.forward * time * 0.1f);
		//}
	}
}
